package com.niiwoo.civet.trade.dto.response.loan;

import java.io.Serializable;


import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
public class ConfirmLoanResponseDTO implements Serializable{
	
	private static final long serialVersionUID = -3950702034050135241L;
	
	public static final int SUCCESS_RET = 0;
	public static final String SUCCESS_RET_MSG = "操作成功。";
	public static final int FAIL_RET = -1;
	public static final String FAIL_RET_MSG = "操作失败。";

	/**
	 * 返回状态标示 0：表示成功， 其它值失败
	 */
	private int ret;
	
	/**
	 * 错误信息
	 */
	private String message;
	
	/**
	 * 错误编码
	 */
	private String errorCode;
	
	/**
	 * 借误异常类
	 */
	private Exception exception;

	/**
	 * 请求返回数据
	 */
	public Object data;
	
	/**
	 * 构造请求成功对象
	 * 
	 * @param data
	 */
	public ConfirmLoanResponseDTO(Object data) {
		this.ret = SUCCESS_RET;
		this.data = data;
	}
	
	/**
	 * 构造自定义错误返回对象
	 * 
	 * @param errorCode
	 * @param message
	 */
	public ConfirmLoanResponseDTO(String errorCode, String message) {
		this.ret = FAIL_RET;
		this.errorCode=errorCode;
		this.message = message;
	}

	/**
	 * 构建带异常自定义错误对象
	 * 
	 * @param errorCode
	 * @param message
	 * @param e
	 */
	public ConfirmLoanResponseDTO(String errorCode, String message, Exception e) {
		this.ret = FAIL_RET;
		this.message = message;
		this.errorCode = errorCode;
		this.exception = e;
	}
}